<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ng-init, ng-if, ng-click, ng-disabled实现网站注册协议设置</title>
    <script src="../angular.js"></script>
</head>
<body>
<!--ng-init 初始化数据-->
<!--ng-if 控制dom的显示隐藏， 默认为true-->
<!--ng-click 点击事件-->
<!--ng-disabled 控制时刻可点击，默认为true，不能点击-->
<div ng-app="web" ng-controller="ctrl" >
    {{status}}<br />
    <label><input type="checkbox" ng-model="status">同意</label>
    <button ng-init="copyright=false" ng-click="copyright=!copyright">查看协议</button><br />
    <textarea ng-if="copyright" role="10" rows="10"> 魔镜，魔镜，谁是这个世界上位 丧 的人</textarea><br />
    <button ng-disabled="!status">登录</button>
</div>

<script>
    var mod = angular.module('web', []);
    mod.controller('ctrl', ['$scope', function ($scope) {

    }])
</script>
</body>
</html>